#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#define MAX 60005
using namespace std;

int sum;
int a[7];
int pack[MAX];
void zeroonepack(int cost, int weight)
{
    for (int i = sum; i >= cost; --i)
        pack[i] = max(pack[i], pack[i - cost] + weight);
}
void manypack(int cost, int weight)
{
    for (int i = cost; i <= sum; ++i)
        pack[i] = max(pack[i], pack[i - cost] + weight);
}
void multpack(int cost, int weight, int num)
{
    if (cost * num >= sum)
    {
        manypack(cost, weight);
        return;
    }
    else
    {
        int k = 1;
        while (k < num)
        {
            zeroonepack(k * cost, k * weight);
            num -= k;
            k *= 2;
        }
        zeroonepack(num * cost, num * weight);
    }
}
int main()
{
    int t = 0;
    while (1)
    {

        sum = 0;
        for (int i = 1; i <= 6; i++)
        {
            cin >> a[i];
            sum += a[i] * i;
        }
        if (!sum)
            break;
        t++;
        printf("Collection #%d:\n", t);
        if (sum % 2)
            cout << "Can't be divided." << endl;
        else
        {
            sum /= 2;
            memset(pack, 0, sizeof(pack));
            for (int i = 1; i <= 6; i++)
            {
                if (a[i])

                    multpack(i, i, a[i]);
            }
            if (sum == pack[sum])
                cout << "Can be divided." << endl;
            else
                cout << "Can't be divided." << endl;
        }
        cout << endl;
    }
}
